20 Mai 2019

Marriage vs Divorce (dataset)

The following is an excerpt of the data used in plot:

##           Bundesland    L_Grad   B_Grad Eheschliessungen Scheidungen
## 1 Baden-Wuerttemberg  9.182932 48.77585            54591       18356
## 2             Bayern 11.581981 48.13513            66790       22599
## 3             Berlin 13.404954 52.52001            12686        6070
## 4        Brandenburg 13.064473 52.39057            14156        4445
## 5             Bremen  8.801694 53.07930             2744        1332
## 6            Hamburg  9.993682 53.55109             5727        2912

Marriage vs Divorce (code)

The main part of the code used to generate the interactive plot:

plot_ly(
  data,
  x = ~Eheschliessungen,
  y = ~Bundesland,
  name = "Marriage",
  type = 'bar',
  orientation = 'h'
) %>%
add_trace(
  x = ~Scheidungen,
  name = "Divorce",
  type = 'bar',
  orientation = 'h'
)

To see the plot, please go to te next slide.

Marriage vs Divorce (plot)

The interactive plot: